package bankaccount;

// 测试类
public class BankAccountTest {
    public static void main(String[] args) {
        // 创建储蓄账户对象
        SavingAccount savingAccount = new SavingAccount("123456", "张三", 1000, 0.02);
        savingAccount.deposit(500);
        savingAccount.calculateInterest();
        System.out.println("储蓄账户类型: " + savingAccount.accountType());
        System.out.println("储蓄账户余额: " + savingAccount.getBalance());

        // 创建支票账户对象
        CheckingAccount checkingAccount = new CheckingAccount("654321", "李四", 800, 500);
        System.out.println("支票账户类型: " + checkingAccount.accountType());
        System.out.println("支票账户余额: " + checkingAccount.getBalance());
        checkingAccount.withdraw(200);
    }
}
